package cn.myplus.uc.user

import org.springframework.hateoas.server.mvc.RepresentationModelAssemblerSupport
import org.springframework.stereotype.Service

/**
 * @project myplus5
 * @description 用户服务类
 * @author libo
 * @date 2023-10-03 16:11:43
 */
@Service
class UserService {
    fun getUserById(id: String): User {
        if (id.isBlank()) {
            throw IllegalArgumentException("查询用户,参数错误.")
        }
        return User("admin", "系统管理员", "admin")
    }

    fun getUsers(): MutableIterable<User> {
        val users = mutableListOf<User>()
        for (i in 0..14) {
            users.add(User("admin$i", "系统管理员$i", "admin$i"))
        }
        return users
    }
}